import request from '@/utils/request'

// 获取公司信息
export const getCompany = (compId) => {
  return request({
    url: `/company/${compId}`
  })
}

// 获取员工列表
export const getEmployeesList = (params) => {
  return request({
    url: '/sys/role',
    params
  })
}

// 删除角色
export const delRole = (id) => {
  return request({
    url: '/sys/role/' + id,
    method: 'DELETE'
  })
}

// 获取员工个人角色信息
export const getRoleDetail = (id) => {
  return request({
    url: '/sys/role/' + id,
    method: 'GET'
  })
}
// 编辑角色
export const editRole = (data) => {
  return request({
    url: '/sys/role/' + data.id,
    method: 'PUT',
    data
  })
}

// 添加角色
export const addRole = (data) => {
  return request({
    url: '/sys/role/',
    method: 'POST',
    data
  })
}

// 获取所有角色列表
export const getRoleList = () => {
  return request({
    url: '/sys/role',
    method: 'GET'
  })
}

// 给角色分配权限
export const allotPermission = (data) => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
